layui.use(['layer','upload'], function () {

    var   layer = layui.layer
        , upload = layui.upload;
    upload.render({ //允许上传的文件后缀
        elem: '#uploadEcel'
        //获取上传地址
        , url: document.getElementById("uploadEcel").getAttribute("url")
        , accept: 'file' //普通文件
        , exts: 'xlsx' //只允许上传压缩文件
        ,field:'file'
        ,data: {
            classeId:document.getElementById("uploadEcel").getAttribute("classeId")
        }
        ,before: function(){
            layer.msg('导入中.......', {
                time: 20000, //20s后自动关闭
            });

        }
        , done: function (res) {
            console.log(res)
            layer.msg('导入成功')
        },
        error: function(res){
            console.log(res)
            layer.msg('网络异常：'+res)
        }
    });

})